﻿using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;

namespace ResourceEnumerator.Inrastructure
{
    public static class DebugLogger
    {
        public static void LogMessage(string message, [CallerMemberName] string caller = null)
        {
#if DEBUG
            Debug.WriteLine(
                $"{DateTime.Now.ToString("HH:mm:ss.fff")} {Thread.CurrentThread.ManagedThreadId} [Jupiter.ResourceEnumerator] [{caller}] {message}");
#else
            Trace.WriteLine(
                $"{DateTime.Now.ToString("HH:mm:ss.fff")} {Thread.CurrentThread.ManagedThreadId} [Jupiter.ResourceEnumerator] [{caller}] {message}");
#endif
        }
    }
}
